package cn.stylefeng.guns.base;

import java.util.*;
import	java.util.stream.Collectors;

import cn.stylefeng.guns.modular.yingbao.entity.SysUserGroup;
import cn.stylefeng.guns.modular.yingbao.util.DateUtils;
import cn.stylefeng.guns.modular.yingbao.util.RandomNum;
import com.alibaba.fastjson.JSONObject;
import org.junit.Test;

/**
 * @author jj
 * @date 2019/12/14 16:43
 */
public class test {
    public static void main(String[] args) {
        long a=1000;
        long money = 20* a / 100 ;
        System.err.println(money);
        Long time = 3600L/ 60 / 60;
        Date date = DateUtils.addDateMinut(new Date(), time.intValue());
        String orderIdByUUId = RandomNum.getOrderIdByUUId();
        String[] uuid = RandomNum.getUUID(10);
        for (int i=0;i<uuid.length;i++){
            System.out.println(uuid[i]);
        }

    }
    @Test
    public void get() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(2);
        arrayList.add(1);
        arrayList.add(3);
        arrayList.add(3);
        arrayList.add(3);
        arrayList.add(3);
        List arrayList2 = new ArrayList();
        arrayList2.add(3);
        arrayList2.add(4);
       arrayList2.retainAll(arrayList);

        System.out.println(arrayList2.size ());

    }


    @Test
    public void get33() {

        System.out.println( 0/100);


    }

    @Test
    public void get23() {
        List<Long> arrayList = new ArrayList();
        Long a=1201114l;
        Long a2=1201113l;
        Long a3=1201112l;
        Long a4=1201111l;
        Long a5=1201114l;
        arrayList.add(a);
        arrayList.add(a3);
        arrayList.add(a2);
        arrayList.add(a4);
        Date date = new Date();
        System.out.println( date);


    }

    @Test
    public void get24() {
        List<String> arrayList = new ArrayList();
        String a="222";

        String a2="2222";
        String a3="22222";
        String a4="222222";
        String a5="222";
        arrayList.add(a);
        arrayList.add(a3);
        arrayList.add(a2);
        arrayList.add(a4);
        System.out.println( arrayList.contains ( a5 ));


    }

    @Test
    public void get1() {
        List<SysUserGroup> arrayList = new ArrayList();
        for (int i=0; i<100;i++){
            System.out.println(i+"###############");
            SysUserGroup sysUserGroup=new SysUserGroup();
            sysUserGroup.setGrade(i%3);
            System.out.println(sysUserGroup.getGrade());
            arrayList.add(sysUserGroup);
        }

        Optional<SysUserGroup> max = arrayList.stream().max(Comparator.comparingInt(SysUserGroup::getGrade));
        SysUserGroup sysUserGroup = max.get();
        System.out.println(sysUserGroup.getGrade());
        String s = JSONObject.toJSONString(arrayList);
        ArrayList arrayList1 = JSONObject.parseObject(s, ArrayList.class);
        System.out.println(s+"222");
        System.out.println(arrayList1);

    }

    @Test
    public void get3() {
       Long arrayList1=-80l;
        System.out.println(arrayList1);

    }
    @Test
    public  void  time(){

        Date date = new Date();

        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        Date date1 = new Date();

        System.out.println(date.after(date1));
    }
}
